# coding=utf-8
import time
import os, sys
import random
BASE_PATH = os.path.dirname(
    os.path.dirname(os.path.abspath(__file__))
)
sys.path.insert(0,BASE_PATH)

from bin import get_Webdriver


class Help_Page:
    def __init__(self):
        self.driver = get_Webdriver.Get_Webdriver().driver

    def jumptoAPIpage(self):
        self.clickhelpButton()
        self.driver.click("css=>.icon-copy")

    def jumptoCoupon(self):
        self.clickhelpButton()
        self.driver.click("css=>.icon-jpy")

    def getpageTitle(self):
        return self.driver.get_text("css=>.user-heading>h1")

    def clickhelpButton(self):
        self.driver.click("css=>.icon-question-sign")

    def gethelpbuttonText(self):
        textlist = []
        # api = self.driver.get_text("css=>.icon-copy")
        api = self.driver.get_text("css=>.dropdown-menu>li>a")
        coupon = self.driver.get_text("css=>.icon-jpy")
        textlist.append(api)
        textlist.append(coupon)
        return textlist
